@node POSIX process environment
@section Process environment

@stindex posix-process-data
These procedures are exported by the structures @code{posix} &
@code{posix-process-data}.

@cindex process ids
@cindex POSIX process ids
@deffn procedure get-process-id @returns{} process-id
@deffnx procedure get-parent-process-id @returns{} process-id
These return the @embedref{POSIX processes, process id} of the current
process or the current process's parent, respectively.
@end deffn

@cindex user ids
@cindex group ids
@cindex POSIX user ids
@cindex POSIX group ids
@deffn procedure get-user-id @returns{} user-id
@deffnx procedure get-effective-user-id @returns{} user-id
@deffnx procedure set-user-id! user-id @returns{} unspecified
@deffnx procedure get-group-id @returns{} group-id
@deffnx procedure get-effective-group-id @returns{} group-id
@deffnx procedure set-group-id! group-id @returns{} unspecified
These access the original and effective @embedref{POSIX users and
groups, user & group ids} of the current process.  The effective ids
may be set, but not the original ones.
@end deffn

@deffn procedure get-groups @returns{} group-id list
@deffnx procedure get-login-name @returns{} string
@code{Get-groups} returns a list of the supplementary groups of the
current process.  @code{Get-login-name} returns a user name for the
current process.
@end deffn

@cindex environment variables
@cindex POSIX environment variables
@deffn procedure lookup-environment-variable string @returns{} string or @code{#f}
@deffnx procedure environment-alist @returns{} alist
@code{Lookup-environment-variable} looks up its argument in the
environment list of the current process and returns the corresponding
string, or @code{#f} if there is none.  @code{Environment-alist}
returns the entire environment as a list of @code{(@var{name-string} .
@var{value-string})} pairs.
@end deffn
